import { Component, OnInit } from '@angular/core';
import {Http} from '@angular/http';
import 'rxjs/add/operator/toPromise';
import { HttpService } from '../../services/http.service';  
import { MyhttpService } from '../../services/myhttp.service';  

@Component({
  selector: 'app-sarch',
  providers: [HttpService],
  templateUrl: './sarch.component.html',
  styleUrls: ['./sarch.component.css']
})
export class SarchComponent implements OnInit {
 alldata;
 afterAll;
 name:'';
 aaa;
  constructor(private httpService:HttpService,private myhttpService:MyhttpService,private http:Http) { }

  ngOnInit() {

     let url = 'http://192.168.10.168:9002/api/ProductSearch?c=&userid=2&sort=bySold&page=1&pagesize=10'
        this.httpService.httpGet(url).subscribe(res =>{
          this.alldata=res.data;
          // console.log(this.alldata);
       }); 

    //  this.myhttpService.getcontacte().then((data)=>{
    //       this.alldata = data.data.spu_list;
    //     })

        
  };

 

}
